package com.hntech.elasticsearch.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @Autho changqi.wu
 * @Date 路在脚下，使劲踩！
 */
@Document(indexName = "news",type = "graph", shards = 1, replicas = 0)
@Data
public class News {


    @Id
    private Long id;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String title; //标题

    @Field(type = FieldType.Keyword)
    private String category;// 分类

    @Field(type = FieldType.Date,pattern = "yyyy-MM-dd HH:mm:ss")
    private Date time; // 时间

    @Field(index = false, type = FieldType.Keyword)
    private String images; // 图片地址


}
